package com.biz.primus.app.erpbridge.controller;

import com.biz.primus.app.erpbridge.feign.DepotFeignClient;
import com.biz.primus.base.support.rest.vo.JsonResult;
import com.biz.primus.model.depot.vo.IncrDepotReqVo;
import com.biz.primus.model.depot.vo.IncrEmpReqVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * DepotBridgeController
 *
 * @author JKLiues
 * @date 2017年11月17日
 */
@RestController
@RequestMapping("bridge/depot")
public class DepotBridgeController extends BaseBridgeController {


    private final DepotFeignClient depotFeignClient;


    @Autowired
    public DepotBridgeController(DepotFeignClient depotFeignClient) {
        this.depotFeignClient = depotFeignClient;
    }

    /**
     * 门店同步方法
     */
    @PostMapping("handleDepot")
    public JsonResult handleDepot(List<IncrDepotReqVo> reqVos) {
        depotFeignClient.handleErpDepots(reqVos);
        return new JsonResult();
    }

    /**
     * 门店员工同步方法
     */
    @PostMapping("handleEmp")
    public JsonResult handleEmp(List<IncrEmpReqVo> reqVos) {
        depotFeignClient.handelErpEmp(reqVos);
        return new JsonResult();
    }
}